
<?php include_once(dirname(__FILE__) . '/../general/head.php'); ?>

<!-- header -->
<?php include_once(dirname(__FILE__) . '/../general/header.php'); ?>

<?php include_once('left.php'); ?>


<div id="page-wrapper">

    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">Thêm đợt đánh giá thái độ</h1>
        </div>
    </div>
    
    <?php
    if($addResult){
    ?>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-success">
                <div class="panel-heading">
                    <?php echo $addResult; ?>
                </div>
            </div>
        </div>
    </div>
    <?php } ?>

    <div class="panel panel-default">
        <div class="panel-heading">
            Thông tin đợt đánh giá
        </div>
        <div class="panel-body">
            <form method="post" action="<?php echo site_url(get_folder($loggedUser['title']).'/attitude_results/add'); ?>">
                <input type="hidden" name="Command" value="Add" />
                <div class="row">
                    <!--Cột trái-->
                    <div class="col-lg-6">
                        <div class="form-group">
                            <label>Tên đợt đánh giá</label>
                            <input type="text" name="name" class="form-control" />
                        </div>
                        
                        <div class="form-group">
                            <input class="btn btn-primary" type="submit" value="Thêm"> </td></tr>
                        </div>
                    </div>
                </div>
            </form>

        </div>
    </div>
    <br>
























    <?php if (false): ?>

        <div id="content" class="testd"><br>
            <h1><?php
                if ($title) {
                    echo $title;
                }
                ?></h1><br>
            <a href="<?php echo site_url('qbank'); ?>">Back </a>
            <?php
            if ($resultstatus) {
                echo "<div id='result'>" . $resultstatus . "</div>";
            }
            ?>
            <div class="wite">
                <form method="post" action="<?php echo site_url('qbank/add_new'); ?>">
                    <table id="formdata">
                        <tr><td valign="top">Select Category</td><td valign="top">
                                <select name="cid">
                                    <?php foreach ($category as $value) { ?>
                                        <option value="<?php echo $value->cid; ?>"><?php echo $value->category_name; ?></option>
                                    <?php } ?></select> </td></tr>
                        <tr><td valign="top">Select Difficult Level</td><td valign="top">
                                <select name="did">
                                    <?php foreach ($difficult_level as $value) { ?>
                                        <option value="<?php echo $value->did; ?>"><?php echo $value->level_name; ?></option>
                                    <?php } ?></select>  </td></tr>
                        <tr><td valign="top">Question</td><td valign="top">
                                <textarea name="question"></textarea> </td></tr>
                        <tr><td valign="top">Description (Optional)<br>
                                Describe how question can be solved. <br>
                                User can see description after submitting quiz in view answer section.
                            </td><td valign="top">
                                <textarea name="description"></textarea> </td></tr>
                        <tr><td valign="top">Options</td><td valign="top">
                            </td></tr>
                        <tr><td valign="top">1) &nbsp;&nbsp; <input type="radio" id="radiobtn" value="0" name="score" selected="selected" ></td><td valign="top">
                                <textarea name="option[]"></textarea> </td></tr>
                        <tr><td valign="top">2) &nbsp;&nbsp; <input type="radio" id="radiobtn" value="1" name="score"></td><td valign="top">
                                <textarea name="option[]"></textarea> </td></tr>
                        <tr><td valign="top">3) &nbsp;&nbsp; <input type="radio" id="radiobtn" value="2" name="score"></td><td valign="top">
                                <textarea name="option[]"></textarea> </td></tr>
                        <tr><td valign="top">4)  &nbsp;&nbsp; <input type="radio" id="radiobtn" value="3" name="score"><?php $op = "5"; ?></td><td valign="top">
                                <textarea name="option[]"></textarea> </td></tr>
                        <?php
                        if ($this->input->post('add')) {
                            for ($j = 1; $j <= $this->input->post('add'); $j++) {
                                ?>
                                <tr><td valign="top"><?php echo $op . ")"; ?> &nbsp;&nbsp; <input type="radio" id="radiobtn" value="<?php echo $op - 1; ?>" name="score"></td><td valign="top"><textarea name="option[]"></textarea>  </td></tr>
                                <?php
                                $op++;
                            }
                        }
                        ?>
                        <tr><td valign="top"></td><td valign="top">
                                <input type="submit" value="Submit"> </td></tr>
                    </table>
                </form>
                <br>
                <table id="formdata">
                    <tr><td valign="top">Add more options </td>
                        <td valign="top">
                            <form method="post" action="<?php echo site_url('qbank/add_new'); ?>">
                                <select name="add">
                                    <?php for ($x = 1; $x <= 100; $x++) { ?>
                                        <option value="<?php echo $x; ?>"><?php echo $x; ?></option>
                                    <?php } ?></select> &nbsp;&nbsp;
                                <input type="submit" value="Add">
                            </form>
                        </td>
                </table>

            </div>
        </div>
    <?php endif; ?>

</div>
<!-- /#page-wrapper -->

<script type="text/javascript">
//    tinyMCE.init({
//        mode: "textareas",
//        theme: "advanced",
//        relative_urls: false,
//        plugins: "jbimages",
//        // ===========================================
//        // PUT PLUGIN'S BUTTON on the toolbar
//        // ===========================================
//
//
//
//        theme_advanced_buttons1: "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
//        theme_advanced_buttons2: "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
//        theme_advanced_buttons3: "tablecontrols,hr,removeformat,visualaid,sub,sup,charmap,emotions,iespell,media,advhr,print,ltr,rtl,fullscreen",
//        theme_advanced_buttons4: "jbimages,insertlayer,moveforward,movebackward,absolute,styleprops,cite,abbr,acronym,del,ins,attribs,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks"
//    });
</script>

<?php include_once(dirname(__FILE__) . '/../general/footer.php'); ?>